<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="img/favicon.png">
    <link rel="stylesheet" href="css/index.css">
    <title>Document</title>
</head>

<body>
    <div id="app" class="container">
        <div class="top-bar padded flex">
            <a href="index.html"><img src="img/xq/logo.png" alt=""></a>
            <form action="" class="flex">
                <input type="text" placeholder="搜索职位">
                <button class="icon-search"></button>
            </form>
        </div>

        <div class="job-info">
            <div class="padded">
                <div class="title flex">
                    <span>{{jobs.title}}</span>
                    <span class="salary">{{jobs.salary}}</span>
                </div>
                <div class="props">
                    <div class="items">
                        <template v-for="(tag,index) in jobs.tags">
                            <i v-if="index > 0"></i>
                            {{tag}}
                        </template>
                    </div>
                    <div class="tags">
                        <span v-for="label in jobs.labels">{{label}}</span>
                    </div>
                    <div>
                        更新于：{{jobs.time}}
                    </div>
                </div>
            </div>



            <div class="user-info flex" v-if="jobs.user">
                <img :src="jobs.user.avatar" alt="">
                <div class="xx">
                    <div class="name flex">
                        <span>{{jobs.user.name}}</span>
                        <img class="likeimg" src="img/xq/link-like.png" alt="">
                        <span class="like">感兴趣</span>
                    </div>
                    <div class="desc gray">{{jobs.user.title}}</div>
                </div>
                <button class="btn">立即沟通</button>
            </div>
        </div>

        <div class="job-detail padded" v-if="jobs.company">
            <h3>职位描述</h3>
            <div class="text" v-html="jobs.body"></div>

            <h3>公司介绍</h3>
            <div class="text">
                {{jobs.company.body}}
            </div>

            <h3>工商信息</h3>
            <div class="text">
                {{jobs.company.fullName}}
                <table>
                    <tr>
                        <th>法人代表：</th>
                        <td>{{jobs.company.props.法人代表}}</td>
                        <th>注册资本：</th>
                        <td>{{jobs.company.props.注册资本}}</td>
                    </tr>
                    <tr>
                        <th>成立时间：</th>
                        <td>{{jobs.company.props.成立时间}}</td>
                        <th>经营状态：</th>
                        <td>{{jobs.company.props.经营状态}}</td>
                    </tr>
                </table>
                <p class="gary"><small>数据来源：企业查</small></p>
            </div>

            <h3>工作地址</h3>
            <div class="map">

            </div>
        </div>


        <div class="company-info padded flex" v-if="jobs.company">
            <img :src="jobs.company.logo" alt="">
            <div class="info">
                <div class="name flex">
                    <span>{{jobs.company.name}}</span>
                    <button type="button" class="btn">关注该公司</button>
                </div>
                <div class="desc">{{jobs.company.fullName}}</div>
                <div class="tags flex">
                    <template v-for="(tag,index) in jobs.company.tags">
                        <i v-if="index > 0"></i>
                        <span>{{tag}}</span>
                    </template>
                </div>
            </div>
        </div>

        <div class="related-jobs padded">
            <h3>相似职位</h3>
            <ul class="job-list">
                <li v-for="item in jobs.jobs">
                    <a href="" class="flex">
                        <img :src="item.logo" alt="">
                        <div class="text">
                            <div class="title">
                                <h4>
                                    <span>{{item.tile}}</span>
                                </h4>
                                <span class="salary">{{item.salary}}</span>
                            </div>
                            <div class="name">{{item.company}}</div>
                            <div class="msg" >
                                <template v-for="tag in item.tags">
                                    <em>{{tag}}</em>
                                </template> 
                            </div>
                        </div>
                    </a>
                </li>
            </ul>
        </div>

        <div class="related-companies padded">
            <h3>城市招聘：</h3>
            <div class="tags">
                <a href="javascript:;">潍坊招聘</a>
                <a href="javascript:;">曲靖招聘</a>
                <a href="javascript:;">安康招聘</a>
                <a href="javascript:;">承德招聘</a>
            </div>
        </div>

        <div class="job-footer breadcrumb-nav">
            <a href="javascript:;">首页</a><i></i>
            <a href="javascript:;">重庆招聘·web前端招聘</a><i></i>
            <a href="javascript:;">重庆web前端招聘</a><i></i>
            <a href="javascript:;">博彦科技前端开发(react)招聘</a>
        </div>
    </div>

    <script src="js/vue.js"></script>
    <script>
        const vm = new Vue({
            el: '#app',
            data: {
                jobs: {}
            },
            created:function(){
                fetch('http://127.0.0.1:5500/api/job.json')
                .then(function(res){
                    return res.json();
                })
                .then(function(data){
                    vm.jobs = data
                })
            }
        })
    </script>
</body>

</html>